{{define "Title"}}Set Item Test{{end}}
{{define "Content"}}

<script type=text/javascript src="/js/enterKey.js"></script>
<script type=text/javascript src="/js/tablestyle.js"></script>

<div class="container-fluid">
<form class="form-horizontal" action="/setitemtest" method="POST">
  <fieldset>
    <legend><b>Set Item Test</b></legend>
    {{if .error}}<div class="alert alert-error"><b>Error: </b>{{.error | html}}</div>
    {{else }}
      {{if .flash}}<div class="alert alert-success"><b>Infomation: </b>{{.flash | html}}</div>{{end}}
    {{end}}
    <div class="control-group">
      <label class="control-label">Item&nbsp;</label>
      <div class="control">
        <select id="item" name="item" style="background-color:#FFFFD0" onkeydown="clicka();" onmousewheel="return false">
          <option value="">
          {{range .items}}
            <option value="{{.Item | html}}">{{.Item | html}}  |  {{.Desc | html}}
          {{end}}
        </select> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">Parameter&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="printname" name="printname" style="background-color: #FFFFD0" onkeydown="clicka();" maxlength="50"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">Test Name&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="testname" name="testname" style="background-color: #FFFFD0" onkeydown="clicka();" maxlength="100"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">Frequency(MHz)&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="freqname" name="freqname" style="background-color: #FFFFD0" onkeydown="clicka();" maxlength="50"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">Ports&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="ports" name="ports" onkeydown="clicka();" maxlength="50">
      </div>
    </div>
    <div class="control-group">
      <label class="control-label">Specification&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="specifi" name="specifi" style="background-color: #FFFFD0" maxlength="50"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="form-actions">
      <button type="submit" class="btn btn-primary">Set Item Test</button>
    </div>
  </fieldset>
</form>
</div>

{{if .testinfo}}
<div class="content-box">
  <div class="content-box-header">
    <p style="font-size: 16px;">&nbsp;&nbsp;<b>Item Test Detail</b></p>
  </div>
  <div class="content-box-content">
    <table id="tbl_ls" border="1" cellspacing="0" cellpadding="0">
      <thead>
        <tr>
          <th>Item</th>
          <th>Parameter</th>
          <th>Test Name</th>
          <th>Frequency(MHz)</th>
          <th>Ports</th>
          <th>Specification</th>
        </tr>  
      </thead>    
      
      <tbody>
        {{range .testinfo}}
        <tr>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" align="center">{{.Item | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Parameter | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.TestName | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Frequency | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Ports | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Specification | html}}</td>
        </tr>
        {{end}}
      </tbody>
      
    </table>
  </div>
</div>

{{end}}

{{end}}